package com.example.administrator.myapplication.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.administrator.myapplication.R;
import com.example.administrator.myapplication.bean.Weather;

import java.util.List;

/**
 * Created by Administrator on 2020/12/14.
 */

public class MyAdapter extends BaseAdapter {

    private Context context;
    private List<Weather.ResultBean> futureBeanList;

    public MyAdapter(Context context, List<Weather.ResultBean> futureBeanList) {
        this.context = context;
        this.futureBeanList = futureBeanList;
    }





    @Override
    public int getCount() {
        return futureBeanList.size();

    }

    @Override
    public Object getItem(int position) {
        return futureBeanList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = View.inflate(context, R.layout.two,null);

        TextView textView1 = (TextView) convertView.findViewById(R.id.listview1);
        TextView textView2 = (TextView) convertView.findViewById(R.id.listview2);
        TextView textView3 = (TextView) convertView.findViewById(R.id.listview3);
        TextView textView4 = (TextView) convertView.findViewById(R.id.listview4);
        textView1.setText(futureBeanList.get(position).getFuture()+"");
        textView2.setText(futureBeanList.get(position).getFuture()+"");
        textView3.setText(futureBeanList.get(position).getFuture()+"");
        textView4.setText(futureBeanList.get(position).getFuture()+"");



        return convertView;
    }
}
